package com.woniuxy.boss.bossassembly.service.impl;

import com.woniu.form.RepairRecordForm;
import com.woniuxy.boss.bossassembly.model.BaRepairRecord;
import com.woniuxy.boss.bossassembly.dao.BaRepairRecordMapper;
import com.woniuxy.boss.bossassembly.service.IBaRepairRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 故障记录表 服务实现类
 * </p>
 *
 * @author HDC
 * @since 2021-05-24
 */
@Service
@Slf4j
public class BaRepairRecordServiceImpl extends ServiceImpl<BaRepairRecordMapper, BaRepairRecord> implements IBaRepairRecordService {
    @Autowired
    private BaRepairRecordMapper baRepairRecordMapper;
    @Override
    public Integer addRepairRecord(RepairRecordForm repairRecordForm) {
        log.info("service增加维修记录{}",repairRecordForm);
        BaRepairRecord repairRecord = new BaRepairRecord();
        repairRecord.setRepairTime(repairRecordForm.getRepairTime());
        repairRecord.setWorkerId(repairRecordForm.getWorkerId());
        repairRecord.setRepairContent(repairRecordForm.getRepairContent());
        repairRecord.setFinishTime(repairRecordForm.getFinishTime());
        repairRecord.setCabinetId(repairRecordForm.getCabinetId());
        repairRecord.setRepairStatus(repairRecordForm.getRepairStatus());
        return baRepairRecordMapper.insert(repairRecord);
    }
}
